<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        table{
            border-collapse:collapse;//表格单元格间距样式
        border:1px solid #0F0;
        }
        tr{
            border:1px solid #333;
            height:30px;
        }
        td{
            border:0px;
            text-align:center;
        }
    </style>
</head>
<body>

<table border="1"  width="1000px"  >
    <tr>
        <td width="100px">
            <div style="text-align:left;"><h4><span>登录密码</span></h4></div>
        </td>
        <td width="600px">
            <div style="text-align:left;"><span></span></div>
        </td>
        <td width="200px">
            <div style="text-align:right;"><input type="button" value="修改" onclick="update()"></div>
        </td>
    </tr>
    <tr>
        <td width="100px">
            <div style="text-align:left;"><h4><span>邮箱验证</span></h4></div>
        </td>
        <td width="600px">
            <div style="text-align:left;"><h6>验证邮箱可帮助您快速找回密码，并可接收订单、演出通知、促销活动等提醒</h6></div>
        </td>
        <td width="300px">
            <div style="text-align:right;"><input type="button" value="立即绑定" onclick="upyou()"></div>
        </td>
    </tr>
    <tr>
        <td width="100px">
            <div style="text-align:left;"><h4><span>手机验证</span></h4></div>
        </td>
        <td width="600px">
            <div style="text-align:left;"><h6>您验证的手机：<span id="phone"></span></h6></div>
        </td>
        <td width="200px">
            <div style="text-align:right;">  <input type="button" onclick="updatetwo()" value="验证">  </div>
        </td>
    </tr>
    <tr>
        <td width="100px">
            <div style="text-align:left;"><h4><span>实名认证</span></h4></div>
        </td>
        <td width="600px">
            <div style="text-align:left;"><h6>认证您的实名信息，提高安全等级</h6></div>
        </td>
        <td width="200px">
            <div style="text-align:right;"><input type="button" value="立即验证" onclick="findName()"></div>
        </td>
    </tr>
</table>

<div class="modal fade" id="myModalName" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModaluserName">
                    实名认证
                </h4>
            </div>
            <div class="modal-body">
                <form method="post" class="form-horizontal" role="form" id="myFormName">
                    <div class="form-group">
                        <div class="col-sm-10">
                            身份证 ：<input type="text" class="form-control" id="userCard" name="userCard" width="100px">
                            <input type="hidden" id="userfour"  name="userId">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="adddcard()">
                    提交更改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>















<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    修改密码
                </h4>
            </div>
            <div class="modal-body">
                <form method="post" class="form-horizontal" role="form" id="myForm">
                    <div class="form-group">
                        <div class="col-sm-10">
                            密码：<input type="text" class="form-control" id="userPwd" name="userPwd" width="100px">
                            <input type="hidden" id="userid"  name="userId">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="submitForm()">
                    提交更改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>


<div class="modal fade" id="myModaltwo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabeltwo">
                    修改电话号
                </h4>
            </div>
            <div class="modal-body">
                <form method="post" class="form-horizontal" role="form" id="myFormtwo">
                    <div class="form-group">
                        <div class="col-sm-10">
                            电话：<input type="text" id="useriPhone" class="form-control" name="useriPhone" width="100px">
                            <input type="hidden" id="useridtwo"  name="userId">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="submitFormtwo()">
                    提交更改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>






<div class="modal fade" id="myModayou" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalyou">
                    修改邮箱
                </h4>
            </div>
            <div class="modal-body">
                <form method="post" class="form-horizontal" role="form" id="myFormyou">
                    <div class="form-group">
                        <div class="col-sm-10">
                            邮箱：<input type="text" class="form-control"id="userEmail" name="userEmail" width="100px">
                            <input type="text" id="userIdthree"  name="userId">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="addyou()">
                    提交更改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>

<script>



    $(function () {
        ooo();
    })

    function ooo() {
        //$("#myModal").modal("show");
        $.ajax({
            url: "../phone/findPhone",
            data: {userId: 1},
            success: function (data) {
                alert("222")
                $("#userid").val(data.userId);
                $("#phone").html(data.useriPhone);
                $("#useridtwo").val(data.userId);
                $("#useriPhone").val(data.useriPhone);
                $("#userIdthree").val(data.userId);
                $("#userfour").val(data.userId)
                $("#userEmail").val(data.userEmail);
                $("#userPwd").val(data.userPwd)
                $("#userCard").val(data.userCard);



            }
        })
    }

    function update() {
        $("#myModal").modal("show");
    }

    function submitForm(){
        $.ajax({
            url:"../phone/update",
            data:$("#myForm").serialize(),
            success:function(){
                alert("修改成功");
                $("#myModal").modal('hide');
            }
        })
    }

    function updatetwo() {
        $("#myModaltwo").modal("show");
    }

    function submitFormtwo(){
        $.ajax({
            url:"../phone/updatePhone",
            data:$("#myFormtwo").serialize(),
            success:function(data){

                alert("修改成功");
                $("#myModaltwo").modal('hide');
            }
        })
    }



    function upyou(){
        $("#myModayou").modal("show");
    }
    function addyou(){
        $.ajax({
            url:"../phone/addyou",
            data:$("#myFormyou").serialize(),
            success:function(){
                alert("修改邮箱成功");
                $("#myModayou").modal('hide');
            }
        })

    }

    function findName(){
        $("#myModalName").modal("show");
    }

    var aaa=  document.getElementById("userCard").value
    if (aaa==null|| aaa==""){
        function adddcard(){
            $.ajax({
                url:"../phone/adddcard",
                data:$("#myFormName").serialize(),
                success:function(data){
                    if (data.code==200){
                        alert("修改邮箱成功");
                        $("#myModalName").modal('hide');
                    }else if (data.code==201) {
                        alert("已认证")
                    }

                }
            })
        }
    }else {
        alert("已认证11111")
    }



    /*function adddcard(){



            $.ajax({
                url:"../phone/adddcard",
                data:$("#myFormName").serialize(),
                success:function(data){
                    if (data.code==200){
                        alert("修改邮箱成功");
                        $("#myModalName").modal('hide');
                    }else if (data.code==201) {
                        alert("已认证")
                    }

                }
            })



    }*/












</script>
</html>